package com.j4dream.bufferedWriter;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/* 给定线程数 每个线程执行的文件数量为一定数值
 * 将一个完整的文件数量拆分成多个文件 每个线程插入相应的拆分文件记录*/
public class CopyOfsmallTest implements Runnable {
	private static long skipNumber = 3;
	private static long skipThread = 3;
	private static long totalRecords = 5;
	private static List<String> reader = new ArrayList<String>();

	public static void main(String[] args) {

		for (int i = 1; i <= totalRecords; i++) {
			reader.add("record:" + i);
		}
		Iterator<String> it = reader.iterator();

		long fullRecords = totalRecords / (skipNumber * skipThread);
		long remainRecords = totalRecords - (skipNumber * skipThread) * fullRecords;
		for (int i = 0; i < fullRecords * skipThread; i++) {
			System.out.println(it.next());
		}
		System.out.println("remainCount:" + remainRecords);

		long remainThread = remainRecords % skipThread;
		while (it.hasNext()) {
			long count = 0;
			count%remainThread;
			count++;
		}
	}
	@Override
	public void run() {
		// TODO Auto-generated method stub
		System.out.println("Test project!");
	}

	public static class SplitFileVO {
		private String splitFileID = "";
		private List<String> count = new ArrayList<String>();
	}
}
